package com.jqq.transform;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

/**
 * @author 姬倩倩
 * @version 1.0
 */

public class OutputStreamWriter_ {
    public static void main(String[] args) throws IOException {
        String filePath = "d:\\jqq.txt";
        String charSet = "utf-8";
        OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream(filePath), charSet);
        osw.write("hi, 于杰");
        osw.close();
        System.out.println("按照 " + charSet + " 保存文件成功~");
    }
}